Skip to main content

All Questions

4votes
1answer
251views

Multithreaded MVC game engine

This is an attempt at a multithreaded model-view-controller based engine for 2d console games (board games, roguelikes that sort of thing.) The code below will provide a fully working example but is ...
Jaldhar's user avatar
4votes
2answers
403views

Multi-threaded Mandelbrot set generator slower than single thread

I am new to parallel programming. I have been playing around with multi-threading and for some reason, multi-threading the Mandelbrot set is slower than running a single thread. I have been trying to ...
Niralana's user avatar
3votes
1answer
2kviews

Asynchronous dispatch queue

Background: This is supposed to be the sole worker thread to carry out long-lasting jobs in a GUI application. The GUI thread should be able to schedule tasks in a non-blocking manner and the tasks ...
Aykhan Hagverdili's user avatar
1vote
2answers
4kviews

C++17 multi threaded thread "pauser"

I needed a way to pause multiple threads from a single parent thread, this was my solution for the general case. I would like advice on code quality and enhancements. I'm particularly interested if ...
Krupip's user avatar
4votes
2answers
2kviews

Allow one thread to execute section while others wait and resume

I have a requirement that is summarized below. ...
jaswant.panchumarti's user avatar
3votes
1answer
4kviews

C++ callback multithreaded, can unregister itself

update: a new version of this code is posted here With this post, i would like to 1) ask for feedback on below code as it stands: do i apply all best practices for c++20? is it safe? is my way to ...
Diederick C. Niehorster's user avatar
3votes
2answers
154views

A simple multithreaded openrct2 maze simulator

I found these two videos by Marcel Vos: (1) (2) that show how you can make hedge mazes that are very hard for the simple roller coaster tycoon 2 park guest AI to solve. Long story short, he eventually ...
Anamne's user avatar
2votes
1answer
424views

C++ implementation of recursive_shared_mutex

I know it's bad to even use recursive_mutex because of its poor performance, let alone a recursive shared mutex. However, I'm doing this just to practice. Any suggestion will be appreciated! ...
Einiemand's user avatar
5votes
2answers
1kviews

C++ multithreading logger class

I have designed a logger class to log messages to a file. It uses an independent thread to log the messages save to a queue previously using the main thread. I want to receive reviews about it. ...
asmmo's user avatar
10votes
2answers
420views

N-Body Optimization

I've created a serial C++ code for gravitational N-Body calculation. Because I expect to have upwards of 8-71 sparse bodies (ie, where Barnes-Hut is not necessarily practical) and running for long ...
Marius Popescu's user avatar
2votes
1answer
711views

Scoped thread using modern C++

I wrote this simple scoped thread to use it as a class member to ensure the the thread running on a class method doesn't continue running after the class has been destructed. Also to spawn threads ...
dev65's user avatar
2votes
1answer
267views

C++ Fixed-size general-purpose thread pool

I've been reading about thread pools in C++ for a few days now and decided to roll out my own. I mainly intend to use it to learn how to implement parallel algorithms at some point in the future but ...
Big Temp's user avatar
2votes
1answer
567views

Processing all files in directory

DO NOT RUN THIS EXAMPLE BLINDLY, IT REMOVES ALL FILES UNDER argv[1] Hello, This little programm should read all files from a given directory and do some work with them. New files are constantly ...
flowit's user avatar
11votes
2answers
11kviews

C++17 thread pool

I've implemented a thread pool in C++17. This is not backwards compatible with C++14, due to the usage of std::invoke_result, which is new to C++17. The focus of ...
osuka_'s user avatar
7votes
2answers
373views

Worker pool implementation

With the new additions in c++11 and c++17 I wanted to create a simple implementation of thread pool. I would like your opinion on: Thread safety API performace and general code quality I also ...
FanciestBanana's user avatar

153050per page
close